// stores/articleStore.js
import { defineStore } from 'pinia'

export const useArticleStore = defineStore('articles', {
  state: () => ({
    articles: [],//全部文章
    todayArticle: null, // 今日文章
    beforeArticles: [] // 往期文章
  }),
  actions: {
    // 更新文章数据的方法
    setArticles(payload) {
      this.articles =payload.data
      this.todayArticle = payload.today
      this.beforeArticles = payload.before
    }
  }
})